package com.xd.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.xd.entity.Homework;

@Repository
public interface HomeworkRepositroy extends JpaRepository<Homework, Long>{
//
	@Transactional
	@Modifying
	@Query(value = "UPDATE Homework SET homework=?1,name=?2,stuid=?3 WHERE id=?4")
	void updateData(String homework,String name,Long stuid,Long id);
	
	@Transactional
	@Modifying
	@Query(value = "UPDATE Homework SET score=?1 WHERE id=?2")
	void giveScore(float score,Long id);
	


}
